package com.example.userwallet.controller;


import com.example.userwallet.entity.Account;
import com.example.userwallet.service.WalletService;
import com.example.userwallet.util.JsonUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.math.BigDecimal;

/**
 * <p>
 * 钱包表 前端控制器
 * </p>
 *
 * @author lyl
 * @since 2023-03-15
 */
@RestController
@RequestMapping("/userwallet/wallet")
@CrossOrigin
public class WalletController {


    @Autowired
    WalletService walletService;

    /**
     * 查询用户钱包余额
     * @param account  用户账户
     * @return 查询结果
     */
    @PostMapping("/balance")
    public JsonUtil SeekBalance(@RequestBody Account account){
        return walletService.SeekBalanceSer(account.getUserAccount());
    }

}

